import ezdxf
# doc = ezdxf.readfile("test.dxf")
# doc = ezdxf.readfile(r"C:\Users\YANG.LEI\Downloads\dxfs\排版实例.dxf")
# doc = ezdxf.readfile(r"D:\dl\inputdxf\0.8改风机板18盘醒发箱10件.dxf")
# doc = ezdxf.readfile(r"D:\dl\error\0.8平表板800x325割5件双温(1).dxf")
# doc = ezdxf.readfile(r"D:\dl\error\06台面2件.dxf")
# doc = ezdxf.readfile(r"D:\dl\error\新建文件夹\06割4套.dxf")
# doc = ezdxf.readfile(r"C:\Users\YANG.LEI\Downloads\bug\1\0.8镜钢侧层板10件 ok.dxf")
# doc = ezdxf.readfile(r"C:\Users\YANG.LEI\Downloads\bug\2\0.6不锈钢1套改 ok999.dxf")
doc = ezdxf.readfile(r"D:\G\dxf-merge-issue\1.dxf")
# helper function
def print_entity(e):
    print("LINE on layer: %s\n" % e.dxf.layer)
    print("start point: %s\n" % e.dxf.start)
    print("end point: %s\n" % e.dxf.end)

# iterate over all entities in modelspace
msp = doc.modelspace()
for e in msp:
    print(e)

    # if e.dxftype() == 'INSERT':
    #     print(e.dxf.name)
    #     print(e.__dict__)
    #     print(e.dxf.__dict__)
    #     print(e.reactors.__dict__)
    # print(e.dxf.layer)
    # if e.dxftype() == 'TEXT':
    #     # print(e.get_text())
    #     print(e.dxf.__dict__)
    #     print(e.__dict__)
        # print(e.doc.__dict__)
        # print(e.xdata.__dict__)
        # print_entity(e)
